package com.hucsmn.phone;

/**
 * 通话套餐测试类。
 */
public class CallPlanTest extends Tester {
    public static void main(String[] args) {
        CallPlan cp = new CallPlan(200.0, 100, 20.0);

        asserts(cp.getDuration() == 200.0);
        asserts(cp.getMessage() == 100);
        asserts(cp.getCost() == 20.0);

        cp.setDuration(500.0);
        cp.setMessage(300);
        cp.setCost(40.0);

        asserts(cp.getDuration() == 500.0);
        asserts(cp.getMessage() == 300);
        asserts(cp.getCost() == 40.0);

        CallService cs = cp;
        Card card = new Card(CardKind.BIG, 10086, "YD", "passwd", 50.0, 0.0, 0L);
        asserts(card.getDuration() == 0.0);
        cs.accumulateDuration(10.0, card);
        asserts(card.getDuration() == 10.0);
    }
}
